package com.bmslz.monitor.base.dto;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.bmslz.monitor.base.util.StringUtils;
import com.bmslz.monitor.base.entity.MonitorModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;


/**
 * @Description: 监控模型管理端搜索对象
 * @Author: bobo
 * @Date: 2025-08-03
 * @Version: V1.0
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "m_monitor_model管理端搜索对象", description = "m_monitor_model管理端搜索对象")
public class MonitorModelSysSearchDto {
    @ApiModelProperty(value = "id")
    private String id;

    @ApiModelProperty(value = "名称")
    private String name;

    @ApiModelProperty(value = "编号")
    private String number;

    @ApiModelProperty(value = "标签")
    private String tag;

    public LambdaQueryWrapper<MonitorModel> wrapper() {
        LambdaQueryWrapper<MonitorModel> wrapper = new LambdaQueryWrapper<>();
        wrapper.like(StringUtils.isNotEmpty(name), MonitorModel::getName, name);
        wrapper.like(StringUtils.isNotEmpty(number), MonitorModel::getNumber, number);
        wrapper.like(StringUtils.isNotEmpty(tag), MonitorModel::getTag, tag);
        wrapper.orderByDesc(MonitorModel::getCreateTime);
        return wrapper;
    }
}
